package com.baizhi.appcontroller;

import com.baizhi.entity.CmfzArticle;
import com.baizhi.service.CmfzArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: renpu
 * @Date: 2019/3/7 14:37
 * @Description:
 */
@RestController
@RequestMapping("/AppArticle")
public class AppArticleController {
    @Autowired
    private CmfzArticleService articleService;

    @GetMapping("selectAppGuru/{userId}")
    public List<CmfzArticle> sds(@PathVariable("userId") int userId){
        return articleService.selectAppGuru(userId);
    }

    @GetMapping("selectIdGuruWithArticle/{articleId}")
    public CmfzArticle selectIdGuruWithArticle(@PathVariable("articleId") int articleId){
        return articleService.selectIdGuruWithArticle(articleId);
    }

    @GetMapping("selectAppGuruAll/{userId}")
    public List<CmfzArticle> selectAppGuruAll(@PathVariable("userId") int userId){
        return articleService.selectAppGuruAll(userId);
    }

}
